package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLByteList;
import HLLib.game.HLMapSprite;
import HLLib.game.HLSprite;
import HLLib.game.HLWorld;
import HLLib.io.HLFile;

public class HLClassWorld extends HLLibClass {
    public HLClassWorld(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLWorld();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).Grid_GetTileType(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLWorld) self).Grid_GetTileType(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 1: {
            ((HLWorld) self).Grid_SetTileType(args.GetInt(0), args.GetInt(1), args.GetInt(2));
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).Grid_GetMapSpriteType(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLWorld) self).Grid_GetMapSpriteType(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 3: {
            ((HLWorld) self).Grid_SetMapSpriteType(args.GetInt(0), args.GetInt(1), args.GetInt(2));
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).Grid_GetTileTrans(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLWorld) self).Grid_GetTileTrans(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 5: {
            ((HLWorld) self).Grid_SetTileTrans(args.GetInt(0), args.GetInt(1), args.GetInt(2));
            break;
        }
        case 6: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).Grid_GetHasMapSpriteNear(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).Grid_GetHasMapSpriteNear(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 7: {
            ((HLWorld) self).Grid_SetHasMapSpriteNear(args.GetInt(0), args.GetInt(1), args.GetBoolean(0));
            break;
        }
        case 8: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).Grid_GetHasMapSprite(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).Grid_GetHasMapSprite(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 9: {
            ((HLWorld) self).Grid_SetHasMapSprite(args.GetInt(0), args.GetInt(1), args.GetBoolean(0));
            break;
        }
        case 10: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).Grid_GetMapSpriteTrans(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLWorld) self).Grid_GetMapSpriteTrans(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 11: {
            ((HLWorld) self).Grid_SetMapSpriteTrans(args.GetInt(0), args.GetInt(1), args.GetInt(2));
            break;
        }
        case 12: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).Grid_GetCDType(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLWorld) self).Grid_GetCDType(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 13: {
            ((HLWorld) self).Grid_SetCDType(args.GetInt(0), args.GetInt(1), args.GetInt(2));
            break;
        }
        case 14: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).Grid_GetCDTrans(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLWorld) self).Grid_GetCDTrans(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 15: {
            ((HLWorld) self).Grid_SetCDTrans(args.GetInt(0), args.GetInt(1), args.GetInt(2));
            break;
        }
        case 16: {
            ((HLWorld) self).LoadImages((HLFile)args.GetObject(0), args.GetInt(0));
            break;
        }
        case 17: {
            ((HLWorld) self).LoadTiles((HLFile)args.GetObject(0));
            break;
        }
        case 18: {
            ((HLWorld) self).LoadMapSprites((HLFile)args.GetObject(0));
            break;
        }
        case 19: {
            ((HLWorld) self).LoadMapSprite((HLMapSprite)args.GetObject(0), (HLFile)args.GetObject(1));
            break;
        }
        case 20: {
            ((HLWorld) self).LoadSpriteSeeds((HLFile)args.GetObject(0), args.GetInt(0));
            break;
        }
        case 21: {
            ((HLWorld) self).LoadGrids((HLFile)args.GetObject(0));
            break;
        }
        case 22: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).LoadGrid(args.GetInt(0), args.GetInt(1), (HLFile)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLWorld) self).LoadGrid(args.GetInt(0), args.GetInt(1), (HLFile)args.GetObject(0)));
            }
            break;
        }
        case 23: {
            ((HLWorld) self).LoadStage(args.GetInt(0), args.GetInt(1));
            break;
        }
        case 24: {
            ((HLWorld) self).Clear();
            break;
        }
        case 25: {
            ((HLWorld) self).ClearTiles();
            break;
        }
        case 26: {
            ((HLWorld) self).ClearMapSprites();
            break;
        }
        case 27: {
            ((HLWorld) self).ClearGrids();
            break;
        }
        case 28: {
            ((HLWorld) self).ClearSpriteInfos();
            break;
        }
        case 29: {
            ((HLWorld) self).ClearAreaInfos();
            break;
        }
        case 30: {
            ((HLWorld) self).CreateCamera();
            break;
        }
        case 31: {
            ((HLWorld) self).SetMapSpritePriorityEnable(args.GetInt(0));
            break;
        }
        case 32: {
            ((HLWorld) self).InitMapSpritePriorityEnableTable();
            break;
        }
        case 33: {
            ((HLWorld) self).SetMapSpritePriorityEnableTable(args.GetInt(0));
            break;
        }
        case 34: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).GetMapSpriteNear(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLWorld) self).GetMapSpriteNear(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 35: {
            ((HLWorld) self).SetGridMapSprite(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3));
            break;
        }
        case 36: {
            ((HLWorld) self).SetGridTile(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3));
            break;
        }
        case 37: {
            ((HLWorld) self).RefreshCamera(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3));
            break;
        }
        case 38: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteNearByAirRightEX((HLSprite)args.GetObject(0), args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteNearByAirRightEX((HLSprite)args.GetObject(0), args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 39: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteNearByAirRight((HLSprite)args.GetObject(0), args.GetInt(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteNearByAirRight((HLSprite)args.GetObject(0), args.GetInt(0)));
            }
            break;
        }
        case 40: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteNearByAirLeftEX((HLSprite)args.GetObject(0), args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteNearByAirLeftEX((HLSprite)args.GetObject(0), args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 41: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteNearByAirLeft((HLSprite)args.GetObject(0), args.GetInt(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteNearByAirLeft((HLSprite)args.GetObject(0), args.GetInt(0)));
            }
            break;
        }
        case 42: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteNearByAirDownEX((HLSprite)args.GetObject(0), args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteNearByAirDownEX((HLSprite)args.GetObject(0), args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 43: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteNearByAirDown((HLSprite)args.GetObject(0), args.GetInt(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteNearByAirDown((HLSprite)args.GetObject(0), args.GetInt(0)));
            }
            break;
        }
        case 44: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteNearByAirUpEX((HLSprite)args.GetObject(0), args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteNearByAirUpEX((HLSprite)args.GetObject(0), args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 45: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteNearByAirUp((HLSprite)args.GetObject(0), args.GetInt(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteNearByAirUp((HLSprite)args.GetObject(0), args.GetInt(0)));
            }
            break;
        }
        case 46: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteLeftOnAirEX((HLSprite)args.GetObject(0), args.GetInt(0), (HLByteList)args.GetObject(1), args.GetInt(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteLeftOnAirEX((HLSprite)args.GetObject(0), args.GetInt(0), (HLByteList)args.GetObject(1), args.GetInt(1)));
            }
            break;
        }
        case 47: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteLeftOnAir((HLSprite)args.GetObject(0), (HLByteList)args.GetObject(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteLeftOnAir((HLSprite)args.GetObject(0), (HLByteList)args.GetObject(1)));
            }
            break;
        }
        case 48: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteRightOnAirEX((HLSprite)args.GetObject(0), args.GetInt(0), (HLByteList)args.GetObject(1), args.GetInt(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteRightOnAirEX((HLSprite)args.GetObject(0), args.GetInt(0), (HLByteList)args.GetObject(1), args.GetInt(1)));
            }
            break;
        }
        case 49: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).IsSpriteRightOnAir((HLSprite)args.GetObject(0), (HLByteList)args.GetObject(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLWorld) self).IsSpriteRightOnAir((HLSprite)args.GetObject(0), (HLByteList)args.GetObject(1)));
            }
            break;
        }
        case 50: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).TryMoveSprite2DEX((HLSprite)args.GetObject(0), args.GetInt(0), (HLByteList)args.GetObject(1), args.GetInt(1), args.GetBoolean(0), args.GetInt(2), args.GetInt(3));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLWorld) self).TryMoveSprite2DEX((HLSprite)args.GetObject(0), args.GetInt(0), (HLByteList)args.GetObject(1), args.GetInt(1), args.GetBoolean(0), args.GetInt(2), args.GetInt(3)));
            }
            break;
        }
        case 51: {
            if (resultOwnerObject == null) {
                ((HLWorld) self).TryMoveSprite2D((HLSprite)args.GetObject(0), (HLByteList)args.GetObject(1), args.GetBoolean(0), args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLWorld) self).TryMoveSprite2D((HLSprite)args.GetObject(0), (HLByteList)args.GetObject(1), args.GetBoolean(0), args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        }
    }
}
